<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <link rel="stylesheet" href="./public/css/bootstrap.min.css">
</head>
<body>
    
    <div class="container">
    <h1>index smarty</h1>
    <a href="./index.php" class="btn btn-primary">首页</a>
    <a href="./index.php?c=User&a=add" class="btn btn-primary">添加</a>
    <br><br>
    {block name='main'}
        <table class="table table-hover" cellpadding="0" cellspacing="0" width="600">
        <tr>
            <th>id</th>
            <th>姓名</th>
            <th>性别</th>
            <th>年龄</th>
            <th>身高</th>
            <th>操作</th>
        </tr>
        {foreach $list as $val}
        <tr>
            <td>{$val['id']}</td>
            <td>{$val['name']}</td>
            <td>
                {if $val['sex'] == 0}男
                {else}女
                {/if}
            </td>
            <td>{$val['age']}</td>
            <td>{$val['height']}</td>
            <td class="col-sm-2">
                <a href="./index.php?c=User&a=edit&id={$val['id']}" class="btn btn-primary">编辑</a>
                <a href="./index.php?c=User&a=del&id={$val['id']}" class="btn btn-danger">删除</a>
            </td>
        </tr>
        {/foreach}
    </table>
    {/block}
    </div>
    
</body>
</html>